import React from 'react';
import { Redirect, useLocation } from 'umi';

export default function UserLayout(props: any) {
  const { pathname } = useLocation();
  if (pathname === '/user' || pathname === '/user/') {
    return <Redirect to="/user/list" />;
  }
  return (
    <div>
      <h1>这里是user专属layout</h1>
      {props.children}
    </div>
  );
}
